let items = document.querySelectorAll(".item");
let audios = document.querySelectorAll("audio");
let audio_list = ["applause", "boo", "gasp", "tada", "victory", "wrong"];
items.forEach((item) => {
  item.addEventListener("click", () => {
    pauseAll();
    let idx = audio_list.indexOf(item.textContent);
    audios[idx].play();
  });
});
// console.log(audios);
function pauseAll() {
  audios.forEach((audio) => {
    audio.pause();
    audio.currentTime = 0;
  });
}
